package com.yashi.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.github.pagehelper.PageInfo;
import com.yashi.entity.TbUser;
import com.yashi.entity.TbUserChat;

/**
 * 用户聊天记录
 * @author haoyun
 *
 */
public interface UserChatService {
	
	/**
	 * 查询用户最后一条消息
	 * @param userchat
	 * @param req
	 * @return
	 */
	List<TbUserChat> selectLastUserChat(TbUserChat userChat,HttpSession session);
	/**
	 * 查询群组最后一条消息
	 * @param record
	 * @return
	 */
	List<TbUserChat> selectLastGroupChat(TbUserChat userChat);
	/**
	 * 根据接收者id和当前用户查询(用户聊天)
	 * @param receiveId
	 * @return
	 */
	PageInfo<TbUserChat> selectUserChat(TbUserChat userChat,Integer startPage,HttpSession session);
	/**
	 * 查询群组消息
	 * @param receiveId
	 * @return
	 */
	PageInfo<TbUserChat> selectGroupChat(TbUserChat userChat,Integer startPage);
	/**
	 * 查询用户文件
	 * @param userChat
	 * @param startPage
	 * @param session
	 * @return
	 */
	PageInfo<TbUserChat> selectUserFiles(TbUserChat userChat,Integer startPage,HttpSession session);
	
	/**
	 * 添加用户聊天记录
	 * @param userChat
	 * @return
	 */
	TbUserChat saveUserChat(TbUserChat userChat,HttpSession session);
	
	/**
	 * 用户上传文件
	 * @param request
	 * @param session
	 * @param userChat
	 * @return
	 */
	List<TbUserChat> multifileUpload(HttpServletRequest request, TbUserChat userChat);
	/**
     * 查询群文件
     * @param receiveId
     * @return
     */
	PageInfo<TbUserChat>  selectFiles(Integer startPage,String receiveId);
	    	
	/**
	 * 添加群组聊天记录
	 * @param userChat
	 * @return
	 */
//	Integer saveGroupChat(TbUserChat userChat,HttpSession session);
	/**
	 * 查询聊天列表
	 * @return
	 */
	List<TbUser> findUserChatList(HttpSession session);
	/**
	 * 跟新消息
	 * @param userChat
	 * @param session
	 * @return
	 */
	Integer updateUserChat(TbUserChat userChat, HttpSession session);
	
}
